#!/bin/sh
# - bp_memmap
# - bp1_memmap
# - bp2_memmap
# - bp3_memmap
# - bp4_memmap
# - bp_disable_mtrr_trim
# - bp_idle
# - bp_maxcpus
# - bp_intel_iommu

# Kernel boot parameters that will impact performance/power
cmdline=" $(cat /proc/cmdline) "

check_param()
{
	param=$1
	eval value="\${$param-null_boot_param}"
	if [ "$value" != "null_boot_param" ]; then
		param_str="${param#*_}"
		[ -n "$value" ] && param_str="$param_str=$value"
		if ! echo "$cmdline" | grep -qF " $param_str "; then
			echo "Missing parameter: $param_str, actual command line:$cmdline"
			exit 1
		fi
	fi
}

check_param "bp_memmap"
check_param "bp1_memmap"
check_param "bp2_memmap"
check_param "bp3_memmap"
check_param "bp4_memmap"
check_param "bp_disable_mtrr_trim"
check_param "bp_idle"
check_param "bp_maxcpus"
check_param "bp_intel_iommu"
